package com.pac.user.dao.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.pac.user.bean.UserHisBean;
import com.pac.user.dao.UserHisDao;

/**
 * 历史用户Dao实现
 * 
 * @author lujun.chen
 * @version [版本号, 2015年5月7日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Repository(value = "userHisDao")
public class UserHisDaoImpl implements UserHisDao {

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public List<UserHisBean> queryUserHis(UserHisBean userHisBean) {
		return sqlSessionTemplate.selectList("queryUserHis", userHisBean);
	}

	@Override
	public String addUserHis(UserHisBean userHisBean) {
		sqlSessionTemplate.insert("addUserHis", userHisBean);
		return userHisBean.getId();
	}

	@Override
	public boolean delUserHis(UserHisBean userHisBean) {
		int n = sqlSessionTemplate.insert("delUserHis", userHisBean);
		return n > 0;
	}

}
